#ifndef INPUTSETTINGSDIALOG_H
#define INPUTSETTINGSDIALOG_H

#include <QDialog>
#include <QSignalMapper>

namespace Ui {
  class InputSettingsDialog;
}




class InputSettingsDialog:public QDialog{
    Q_OBJECT

  public:
    explicit InputSettingsDialog(void* mainWindow,QWidget* parent=nullptr);
    ~InputSettingsDialog();

    void PadPressEvent(int Index,uint32_t Button);
    void PadReleaseEvent(int Index,uint32_t Button);

  protected:
    void closeEvent(QCloseEvent* event);
    
    void keyPressEvent(QKeyEvent* event);
    void keyReleaseEvent(QKeyEvent* event);

  private:

    struct ButtonInstance{
      QPushButton* btn;
      uint32_t KeyVal;
    };

    Ui::InputSettingsDialog *ui;

    void* mainWindow;
    bool IsInit;
    ButtonInstance Buttons[20];
    QSignalMapper* mapper;
    int HighLightBtnId;

    void Buttons_Init(int instanceIndex,QPushButton* btn,uint32_t KeyVal);
    void Buttons_Event(int);
};




#endif // INPUTSETTINGSDIALOG_H
